#ifndef __IMA_EMAIL_NOTIFIER_H__
#define __IMA_EMAIL_NOTIFIER_H__

#include "ImaInfoRecipient.h"
#include "vmime/vmime.hpp"
#include "vmime/platforms/posix/posixHandler.hpp"

class ImaEmailNotifier {
	public:
		ImaEmailNotifier(const std::string& strSmtpUrl, const std::string& strUsername, const std::string strPassword);
		~ImaEmailNotifier();

		bool notify(const ImaInfo* pInfo, std::vector<ImaRecipient*>& recipientVector);
		bool notify(const char* pMsgSub, const char* pMsgBody, const char* pRecipientEmailId);
		bool notify(const char* pRecipientEmailId, const char* pSenderName, const char* pSenderEmail, const char* pMsgSub, const char* pMsgBody);
		int init();

	private:
		vmime::utility::url mSmtpUrl;
		std::string mUsername;
		std::string mPassword;
		vmime::ref <vmime::net::session> mSmtpSession;;
		vmime::ref <vmime::net::transport> mTransport;
};

#endif //__IMA_EMAIL_NOTIFIER_H__
